import numpy as np
import torch
import random
import math
import torch.nn.functional as F
import matplotlib.pyplot as plt
import re
import torch.nn as nn

m = nn.Conv2d(3, 3, 1, stride=1)  # 输入通道数3，输出通道数3即核数为3
a = torch.ones(1*3*1*1).reshape(1, 3, 1, 1)  # 第二列的3代表输入通道数 这个数字一定要和Conv2d一致
result = m(a)
print(result)  # 每次执行运行结果不一样 说明里边必有随机数 断点后我发现里边有uniform 所以我估计
print(result.shape)
print('*'*100)
for i in m.named_parameters():  # 可以点进去看看
    print(i)
print('*'*100)
for i in m.parameters():  # 从结果上来看named_parameters多返回个name
    print(i)
